import os

dict = {"beagle": 0, "dachshund": 1, "dalmatian": 2, "jindo": 3, "maltese": 4, "pomeranian": 5, "retriever": 6,
        "ShihTzu": 7, "toypoodle": 8, "Yorkshireterrier": 9}

path = "G:/datasets/分类/dog_class_num=10/val"
f = open("dog/test.txt", 'w', encoding='utf-8')
for file in os.listdir(path):
    for image in os.listdir(os.path.join(path, file)):
        f.write(str(dict[file])+' '+os.path.join(path,file,image))
        f.write('\n')
